package com.dp;

public class Solution03 {
    public int climbStairs(int n) {
        if (n<=2) return n;
        int dp1 = 1;
        int dp2 = 2;
        int res = 0;
        for (int i = 3; i <= n ; i++) {
            res =dp1+dp2;
            dp1 =dp2;
            dp2 = res;
        }
        return res;
    }
}
